Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flip it if you can't collapse it #8609

Open
wants to merge 12 commits into
base: 5.6.x-branch
Choose a base branch
from

Conversation

sloriot
Copy link
Member

@sloriot sloriot commented Nov 14, 2024

if a needle is also a cap, it will be handled as a needle only. But if we can't collapse the edge, a flip will not be tried. Try the flip too.

Note that this will slow down the method as the status of a triangle is tested twice.

Fix #8605

@MaelRL MaelRL added the TODO label Dec 7, 2024
Here are some changes:
- Avoid a lot of redundant calls of is_it_a_needle / is_it_a_cap
  - Do not test for cap-ness if it's already a needle
  - Do not fill both ranges at the beginning, but fill
    with everything: on the first round, needle-ness will
    be tested, and the exit towards cap-ness will happen
  - Wait for a needle to no longer be a needle, or not be
    treatable to actually test cap-ness
- When the mesh is modified, do not test everything immediately,
  just put them in the queue of the next iteration

Result: Fewer calls to shape predicates

- master -
needle calls = 828 668
cap calls = 803 330

- PR -
needle calls = 803 554
cap calls = 795 317

Should be fewer but two effects are balacing each other for the calls:
- much fewer calls to shape predicates (is_it_a_needle, is_it_a_cap)
  by not calling until absolutely necessary (but still checking at pop time).
- when we modify the mesh, I no longer fill the CURRENT cap and needle
  ranges, but the next ones. The point is to really prioritize all caps
  BEFORE treating needles, whereas otherwise we would treat some needles
  at the current iteration while there are still caps to treat.
So there are more iterations which add more useless calls (see below)
@MaelRL
Copy link
Member

MaelRL commented Dec 9, 2024

Here are some changes:

  • Avoid a lot of redundant calls of is_it_a_needle / is_it_a_cap
    • Always avoid testing for cap-ness if it's already a needle
    • Wait for a needle to no longer be a needle, or not be treatable to actually test cap-ness
    • No need to fill both ranges at the beginning: if we start from all faces, needle-ness will be tested, and the exit towards cap-ness will happen if its not a needle
  • When the mesh is modified, do not test everything immediately, but put them in the queue of the next iteration (which will test for needle-ness through the "is it still a needle?" mechanism)

Result: Fewer calls to shape predicates; for example

  • master -
    needle calls = 828 668
    cap calls = 803 330

  • PR -
    needle calls = 803 554
    cap calls = 795 317

Should be fewer but the base there is a fixed base cost at 735k faces and two effects are balancing each other for the calls:

  • much fewer calls to shape predicates (is_it_a_needle, is_it_a_cap) by not calling until absolutely necessary (but still checking at pop time).
  • when we modify the mesh, I no longer fill the CURRENT cap and needle ranges, but the next ones. The point is to really prioritize all caps BEFORE treating needles, whereas otherwise we would treat some needles at the current iteration while there are still caps to treat.

@MaelRL
Copy link
Member

MaelRL commented Dec 9, 2024

Gives a slight improvement on the quality too (PR = before last batch of commits, TMP = after last batch of commits):

Screenshot From 2024-12-07 15-11-28

sloriot added a commit that referenced this pull request Dec 10, 2024
…8651)

## Summary of Changes

Fix an action  not being in the correct menu.


![image](https://github.com/user-attachments/assets/3bf28234-3927-4def-9182-a923ce8d10a4)

Not done in #8609 because that PR
targets 5.6.

## Release Management

* Affected package(s): `Lab`
* Issue(s) solved (if any): -
* Feature/Small Feature (if any): -
* License and copyright ownership: no change
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants